import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {BasicPublicRegionQuery, BasicPublicRegionVO} from "@/api/basicPublic/basicPublicRegion/types";


/**
 * 查询省市区街道办事处字典列表
 * @param query
 * @returns {*}
 */

export const listBasicPublicRegion = (query?: BasicPublicRegionQuery): AxiosPromise<BasicPublicRegionVO[]> => {
  return request({
    url: '/basicPublic/region/list',
    method: 'get',
    params: query
  });
};


/**
 * 根据code获取其下级省市区街道办事处字典列表
 * @param query
 * @returns {*}
 */

export const getBasicPublicRegion = (query?: BasicPublicRegionQuery): AxiosPromise<BasicPublicRegionVO[]> => {
  return request({
    url: '/basicPublic/region/getListByParentCode/' + query.parentCode,
    method: 'get',
  });
};
